#! /bin/bash
export LANG=zh_CN.UTF-8
HIVE_HOME=/usr/bin/hive


${HIVE_HOME} -S -e "
create database if not exists edu_dwb;
use edu_dwb;
drop table if exists kxh_dwb_web_chat_ems_wide;
create table if not exists kxh_dwb_web_chat_ems_wide(
     id   int comment '主键',
    session_id                   string   comment '七陌sessionId',
    sid                          string comment '访客id',
    create_time                  string     comment '会话创建时间',
    seo_source                   string comment '搜索来源',
    ip                           string  comment 'IP地址',
    area                         string  comment '地域',
    origin_channel               string   comment '投放渠道',
    msg_count                    int    comment '客户发送消息数',
     from_url             string comment '会话来源页面'
)comment '访问咨询信息宽表'
row format delimited
fields terminated by '\t'
stored as orc tblproperties ('orc.compress'='snappy');"